import wx

class MyFrame(wx.Frame):
    def __init__(self):
        super().__init__(None, title = '选项卡', size = (500, 600))
        # 先有notebook
        notebook = wx.Notebook(self)
        # 每个选项卡对应的一个面板，面板上放其他元素
        panel1 = wx.Panel(notebook)
        panel2 = wx.Panel(notebook)
        notebook.AddPage(panel1, '选项卡1')
        notebook.AddPage(panel2, '选项卡2')
        # 面板上添加元素
        text = wx.StaticText(panel1, label = 'Hello Notebook')
        text_ctrl = wx.TextCtrl(panel2)
        self.Show()

app = wx.App()
frame = MyFrame()
app.MainLoop()